import { Next,Context } from 'koa'
import User from '../model/users'

export default async function (ctx: Context, next: Next) {
  const user = await User.findById(ctx.params.id)
  if (!user) {
    ctx.throw(404, '用户不存在')
  }
  await next()
}
